<?php

namespace yak\layui\models;

/**
 * This is the model class for table "lay_dictionary".
 *
 * @property string $sign
 * @property string|null $name
 * @property string $value
 * @property int|null $active
 */
class Dictionary extends Yak
{
    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return '{{%dictionary}}';
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['sign', 'value'], 'required'],
            [['active'], 'integer'],
            [['active'], 'default', 'value' => 1],
            [['sign'], 'string', 'max' => 128],
            [['name', 'value'], 'string', 'max' => 255],
            [['sign'], 'unique'],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'sign' => '标识',
            'name' => '描述',
            'value' => '值',
            'active' => '激活',
        ];
    }
}
